package petrochina.company.electric.ui.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import petrochina.company.electric.R;
import petrochina.company.electric.app.AppAdapter;
import petrochina.company.electric.model.TaskApplyEquipData;

/**
 * 断路器
 * desc   : 状态数据列表
 */
public final class ApplyBreakerNumAdapter extends AppAdapter<TaskApplyEquipData> {

    public ApplyBreakerNumAdapter(Context context) {
        super(context);
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder();
    }

    private final class ViewHolder extends AppAdapter<?>.ViewHolder {

        private final TextView mTextView;

        private ViewHolder() {
            super(R.layout.apply_selected_item);
            mTextView = findViewById(R.id.tv_apply_selected_text);
        }

        @Override
        public void onBindView(int position) {
            mTextView.setSelected(true);
            mTextView.setText(getItem(position).getEquipName());
        }
    }
}